#pragma once
#include <boost/asio.hpp>
#include "serverrequest.h"
#include <vector>

class CClientContext : public IClientContext
{
private:
	CClientContext(boost::asio::io_service& ios);
	~CClientContext();

private:
	long								m_nRef;

public:
	boost::asio::ip::tcp::socket		m_sock;
	std::vector<char>					m_vctrecv;
	char								m_recvbuf[1048]; // (1046 + 7)/8

public:
	virtual void __stdcall	AddRef();
	virtual void __stdcall	Release();
	virtual bool __stdcall	GetContext(ClientContext cc, void* p);
	virtual bool __stdcall	Send(unsigned char* pSend, int nLen);

public:
	static CClientContext*	CreateClient(boost::asio::io_service& ios);
};